package br.com.tiespec.web.Util;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.primefaces.model.LazyDataModel;
import org.primefaces.model.SortOrder;

import br.com.tiespec.model.Modelo.Anexo;
import br.com.tiespec.model.Modelo.Artefato;
import br.com.tiespec.model.Modelo.Ator;
import br.com.tiespec.model.Modelo.Cenario;
import br.com.tiespec.model.Modelo.CenarioBase;
import br.com.tiespec.model.Modelo.ClientePortal;
import br.com.tiespec.model.Modelo.ClienteProjeto;
import br.com.tiespec.model.Modelo.Contato;
import br.com.tiespec.model.Modelo.Dado;
import br.com.tiespec.model.Modelo.DescricaoEstendida;
import br.com.tiespec.model.Modelo.Documento;
import br.com.tiespec.model.Modelo.Fluxo;
import br.com.tiespec.model.Modelo.FluxoBase;
import br.com.tiespec.model.Modelo.Perfil;
import br.com.tiespec.model.Modelo.Projeto;
import br.com.tiespec.model.Modelo.Usuario;

@SuppressWarnings("serial")
public class InitUtil {

	public static LazyDataModel<Anexo> inicializaAnexoList() {
		LazyDataModel<Anexo> modelList = new LazyDataModel<Anexo>() {
			@Override
			public List<Anexo> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<Anexo>();
			}
			@Override
			public Anexo getRowData(String rowKey) {
				return new Anexo();
			}
			@Override
			public String getRowKey(Anexo objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<Artefato> inicializaArtefatoList() {
		LazyDataModel<Artefato> modelList = new LazyDataModel<Artefato>() {
			@Override
			public List<Artefato> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<Artefato>();
			}
			@Override
			public Artefato getRowData(String rowKey) {
				return new Artefato();
			}
			@Override
			public String getRowKey(Artefato objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<Ator> inicializaAtorList() {
		LazyDataModel<Ator> modelList = new LazyDataModel<Ator>() {
			@Override
			public List<Ator> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<Ator>();
			}
			@Override
			public Ator getRowData(String rowKey) {
				return new Ator();
			}
			@Override
			public String getRowKey(Ator objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<Cenario> inicializaCenarioList() {
		LazyDataModel<Cenario> modelList = new LazyDataModel<Cenario>() {
			@Override
			public List<Cenario> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<Cenario>();
			}
			@Override
			public Cenario getRowData(String rowKey) {
				return new Cenario();
			}
			@Override
			public String getRowKey(Cenario objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<CenarioBase> inicializaCenarioBaseList() {
		LazyDataModel<CenarioBase> modelList = new LazyDataModel<CenarioBase>() {
			@Override
			public List<CenarioBase> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<CenarioBase>();
			}
			@Override
			public CenarioBase getRowData(String rowKey) {
				return new CenarioBase();
			}
			@Override
			public String getRowKey(CenarioBase objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<ClientePortal> inicializaClientePortalList() {
		LazyDataModel<ClientePortal> modelList = new LazyDataModel<ClientePortal>() {
			@Override
			public List<ClientePortal> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<ClientePortal>();
			}
			@Override
			public ClientePortal getRowData(String rowKey) {
				return new ClientePortal();
			}
			@Override
			public String getRowKey(ClientePortal objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<ClienteProjeto> inicializaClienteProjetoList() {
		LazyDataModel<ClienteProjeto> modelList = new LazyDataModel<ClienteProjeto>() {
			@Override
			public List<ClienteProjeto> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<ClienteProjeto>();
			}
			@Override
			public ClienteProjeto getRowData(String rowKey) {
				return new ClienteProjeto();
			}
			@Override
			public String getRowKey(ClienteProjeto objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<Contato> inicializaContatoList() {
		LazyDataModel<Contato> modelList = new LazyDataModel<Contato>() {
			@Override
			public List<Contato> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<Contato>();
			}
			@Override
			public Contato getRowData(String rowKey) {
				return new Contato();
			}
			@Override
			public String getRowKey(Contato objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	
	public static LazyDataModel<Dado> inicializaDadoList() {
		LazyDataModel<Dado> modelList = new LazyDataModel<Dado>() {
			@Override
			public List<Dado> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<Dado>();
			}
			@Override
			public Dado getRowData(String rowKey) {
				return new Dado();
			}
			@Override
			public String getRowKey(Dado objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<DescricaoEstendida> inicializaDescricaoEstendidaList() {
		LazyDataModel<DescricaoEstendida> modelList = new LazyDataModel<DescricaoEstendida>() {
			@Override
			public List<DescricaoEstendida> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<DescricaoEstendida>();
			}
			@Override
			public DescricaoEstendida getRowData(String rowKey) {
				return new DescricaoEstendida();
			}
			@Override
			public String getRowKey(DescricaoEstendida objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<Documento> inicializaDocumentoList() {
		LazyDataModel<Documento> modelList = new LazyDataModel<Documento>() {
			@Override
			public List<Documento> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<Documento>();
			}
			@Override
			public Documento getRowData(String rowKey) {
				return new Documento();
			}
			@Override
			public String getRowKey(Documento objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<Fluxo> inicializaFluxoList() {
		LazyDataModel<Fluxo> modelList = new LazyDataModel<Fluxo>() {
			@Override
			public List<Fluxo> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<Fluxo>();
			}
			@Override
			public Fluxo getRowData(String rowKey) {
				return new Fluxo();
			}
			@Override
			public String getRowKey(Fluxo objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<FluxoBase> inicializaFluxoBaseList() {
		LazyDataModel<FluxoBase> modelList = new LazyDataModel<FluxoBase>() {
			@Override
			public List<FluxoBase> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<FluxoBase>();
			}
			@Override
			public FluxoBase getRowData(String rowKey) {
				return new FluxoBase();
			}
			@Override
			public String getRowKey(FluxoBase objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<Perfil> inicializaPerfilList() {
		LazyDataModel<Perfil> modelList = new LazyDataModel<Perfil>() {
			@Override
			public List<Perfil> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<Perfil>();
			}
			@Override
			public Perfil getRowData(String rowKey) {
				return new Perfil();
			}
			@Override
			public String getRowKey(Perfil objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<Projeto> inicializaProjetoList() {
		LazyDataModel<Projeto> modelList = new LazyDataModel<Projeto>() {
			@Override
			public List<Projeto> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<Projeto>();
			}
			@Override
			public Projeto getRowData(String rowKey) {
				return new Projeto();
			}
			@Override
			public String getRowKey(Projeto objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}
	
	public static LazyDataModel<Usuario> inicializaUsuarioList() {
		LazyDataModel<Usuario> modelList = new LazyDataModel<Usuario>() {
			@Override
			public List<Usuario> load(int first, int pageSize,
					String sortField, SortOrder sortOrder, Map<String, String> filters) {
				return new ArrayList<Usuario>();
			}
			@Override
			public Usuario getRowData(String rowKey) {
				return new Usuario();
			}
			@Override
			public String getRowKey(Usuario objeto) {
				if (objeto != null)
					return ""+objeto.getId();
				return "";
			}
		};
		modelList.setPageSize(5);
		return modelList;
	}

}